using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace RRHH.Models.Mapping
{
    public class REMUNERACIONINICIALMap : EntityTypeConfiguration<REMUNERACIONINICIAL>
    {
        public REMUNERACIONINICIALMap()
        {
            // Primary Key
            this.HasKey(t => new { t.IDPERSONAL, t.CODIGOEMPLEADO, t.IDCONCEPTO });

            // Properties
            this.Property(t => t.IDPERSONAL)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.CODIGOEMPLEADO)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.IDCONCEPTO)
                .IsRequired()
                .HasMaxLength(4);

            this.Property(t => t.FLAGESTADO)
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("REMUNERACIONINICIAL");
            this.Property(t => t.IDPERSONAL).HasColumnName("IDPERSONAL");
            this.Property(t => t.CODIGOEMPLEADO).HasColumnName("CODIGOEMPLEADO");
            this.Property(t => t.IDCONCEPTO).HasColumnName("IDCONCEPTO");
            this.Property(t => t.MONTOCONCEPTO).HasColumnName("MONTOCONCEPTO");
            this.Property(t => t.FLAGESTADO).HasColumnName("FLAGESTADO");
        }
    }
}
